<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../../../../print.css" type="text/css" media="print">
<meta content="Queue,org.puremvc.as3.multicore.utilities.pipes.plumbing.Queue,messages,mode,flush,sortMessagesByPriority,store,write" name="keywords">
<title>org.puremvc.as3.multicore.utilities.pipes.plumbing.Queue</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Queue - API Documentation';
				var baseRef = '../../../../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">PureMVC AS3 MultiCore Pipes Utility</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../../../../all-classes.html')" href="../../../../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../../../all-classes.html')" href="../../../../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../../../index-list.html')" href="../../../../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../../../../index.html?org/puremvc/as3/multicore/utilities/pipes/plumbing/Queue.html&amp;org/puremvc/as3/multicore/utilities/pipes/plumbing/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Queue</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Queue"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.puremvc.as3.multicore.utilities.pipes.plumbing</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Queue</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Queue <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../../../../images/inherit-arrow.gif"> <a href="Pipe.html">Pipe</a></td>
</tr>
</table>
<p></p> 
  Pipe Queue.
  <P>
  The Queue always stores inbound messages until you send it
  a FLUSH control message, at which point it writes its buffer 
  to the output pipe fitting. The Queue can be sent a SORT 
  control message to go into sort-by-priority mode or a FIFO 
  control message to cancel sort mode and return the
  default mode of operation, FIFO.</P>
  
  <P>
  NOTE: There can effectively be only one Queue on a given 
  pipeline, since the first Queue acts on any queue control 
  message. Multiple queues in one pipeline are of dubious 
  use, and so having to name them would make their operation 
  more complex than need be.</P> 
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a><a name="protectedPropertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Properties</div>
<div class="showHideLinks">
<div class="hideInheritedProtectedProperty" id="hideInheritedProtectedProperty">
<a onclick="javascript:setInheritedVisible(false,'ProtectedProperty');" href="#protectedPropertySummary" class="showHideLink"><img src="../../../../../../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Protected Properties</a>
</div>
<div class="showInheritedProtectedProperty" id="showInheritedProtectedProperty">
<a onclick="javascript:setInheritedVisible(true,'ProtectedProperty');" href="#protectedPropertySummary" class="showHideLink"><img src="../../../../../../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Protected Properties</a>
</div>
</div>
<table id="summaryTableProtectedProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#messages">messages</a> : Array<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#mode">mode</a> : String<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="hideInheritedProtectedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../../../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="Pipe.html#output">output</a> : <a href="../interfaces/IPipeFitting.html">IPipeFitting</a>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol"><a href="Pipe.html">Pipe</a></td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<div class="showHideLinks">
<div class="hideInheritedMethod" id="hideInheritedMethod">
<a onclick="javascript:setInheritedVisible(false,'Method');" href="#methodSummary" class="showHideLink"><img src="../../../../../../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Methods</a>
</div>
<div class="showInheritedMethod" id="showInheritedMethod">
<a onclick="javascript:setInheritedVisible(true,'Method');" href="#methodSummary" class="showHideLink"><img src="../../../../../../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Methods</a>
</div>
</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Queue()">Queue</a>(output:<a href="../interfaces/IPipeFitting.html">IPipeFitting</a> = null)</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../../../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Pipe.html#connect()">connect</a>(output:<a href="../interfaces/IPipeFitting.html">IPipeFitting</a>):Boolean</div>
<div class="summaryTableDescription">
   Connect another PipeFitting to the output.</div>
</td><td class="summaryTableOwnerCol"><a href="Pipe.html">Pipe</a></td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../../../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Pipe.html#disconnect()">disconnect</a>():<a href="../interfaces/IPipeFitting.html">IPipeFitting</a>
</div>
<div class="summaryTableDescription">
   Disconnect the Pipe Fitting connected to the output.</div>
</td><td class="summaryTableOwnerCol"><a href="Pipe.html">Pipe</a></td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#write()">write</a>(message:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>):Boolean</div>
<div class="summaryTableDescription">
   Handle the incoming message.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#flush()">flush</a>():Boolean</div>
<div class="summaryTableDescription">
   Flush the queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#sortMessagesByPriority()">sortMessagesByPriority</a>(msgA:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>, msgB:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>):Number</div>
<div class="summaryTableDescription">
   Sort the Messages by priority.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#store()">store</a>(message:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>):void</div>
<div class="summaryTableDescription">
   Store a message.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="messages"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">messages</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>protected var messages:Array</code>
</div>
<a name="mode"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">mode</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var mode:String</code>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Queue()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Queue</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Queue(output:<a href="../interfaces/IPipeFitting.html">IPipeFitting</a> = null)</code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">output</span>:<a href="../interfaces/IPipeFitting.html">IPipeFitting</a></code> (default = <code>null</code>)<code></code></td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="flush()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">flush</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>protected function flush():Boolean</code><p>
   Flush the queue.
   <P>
   NOTE: This empties the queue.</P>
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; Boolean true if all messages written successfully.
   </td>
</tr>
</table>
</div>
<a name="sortMessagesByPriority()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">sortMessagesByPriority</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function sortMessagesByPriority(msgA:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>, msgB:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>):Number</code><p>
   Sort the Messages by priority.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">msgA</span>:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">msgB</span>:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code></td>
</tr>
</table>
</div>
<a name="store()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">store</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function store(message:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>):void</code><p>
   Store a message.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">message</span>:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a></code> &mdash; the IPipeMessage to enqueue.
   </td>
</tr>
</table>
</div>
<a name="write()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">write</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public override function write(message:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a>):Boolean</code><p>
   Handle the incoming message.
   <P>
   Normal messages are enqueued.</P>
   <P>
   The FLUSH message type tells the Queue to write all 
   stored messages to the ouptut PipeFitting, then 
   return to normal enqueing operation.</P>
   <P>
   The SORT message type tells the Queue to sort all 
   <I>subsequent</I> incoming messages by priority. If there
   are unflushed messages in the queue, they will not be
   sorted unless a new message is sent before the next FLUSH.
   Sorting-by-priority behavior continues even after a FLUSH, 
   and can be turned off by sending a FIFO message, which is 
   the default behavior for enqueue/dequeue.</P> 
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">message</span>:<a href="../interfaces/IPipeMessage.html">IPipeMessage</a></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
